package com.etc.dao;

import com.etc.entity.Orders;
import com.etc.tools.PageData;

/**
 * 订单表的Dao接口
 * 
 * @author
 *
 */
public interface OrdersDao {
	// 增加商品
	public boolean addOrders(Orders orders);

	// 删除订单
	public boolean delOrders(int orderid);

	// 修改订单(只能修复商品数量,订单状态和总花费)
	public boolean upOrders(int ordersum, int orderstate, double total, int orderid);

	// 修改订单状态
	public boolean upOrdersState(int orderstate, String orderid);

	// 查找订单(买家id)
	public PageData<Orders> queryOrdersUserid(int page, int pageSize, int userid);

	// 查找订单(订单状态)
	public PageData<Orders> queryOrdersState(int page, int pageSize, int orderstate);

	// 查询商品详细信息(商品详情)
	public Orders queryOneOrders(int orderid);

	// 查找订单(订单状态)
	public PageData<Orders> getByPage(String keywords, String begindate, String enddate, int pageNo, int pageSize);

	
	public PageData<Orders> getOrderAndItemsByPage(String keywords, String begindate, String enddate, int pageNo, int pageSize) ;
		
	
	/**
	 * 
	 * <p>
	 * Title: addOrder 添加订单
	 * </p>
	 * 
	 * <p>
	 * Description:
	 * </p>
	 * 
	 * @param orders 包含了订单，订单项目（List<Items>）
	 * @return true 添加成功 false 添加失败
	 * 
	 */
	public boolean addOrder(Orders orders);
}
